<?php

namespace App\Repositories\Menu;

use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\Menu\AdminMenuRepository;
use App\Models\Menu\AdminMenu;
use App\Validators\Menu\AdminMenuValidator;

/**
 * Class AdminMenuRepositoryEloquent.
 *
 * @package namespace App\Repositories\Menu;
 */
class AdminMenuRepositoryEloquent extends BaseRepository implements AdminMenuRepository
{
    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return AdminMenu::class;
    }

    

    /**
     * Boot up the repository, pushing criteria
     */
    public function boot()
    {
        $this->pushCriteria(app(RequestCriteria::class));
    }

    /**
     * 获取菜单列表
     * @author Jerry
     * @return mixed
     */
    public function findMenus()
    {
        return $this->orderBy('order', 'desc')->get();
    }
    
}
